Merging delta object notation documents

ABSTRACT

The present disclosure involves systems, software, and computer implemented methods for creating and merging delta object notation documents. One example method includes receiving a request to merge a first delta object notation document and a second delta object notation document. Child properties are identified in the first delta object notation document that include a delta directive and an affected property name that the delta directive is configured to affect. For each child property, a determination is made as to whether a matching child property exists in the second delta object notation document. In response to determining that a matching child property exists in the second delta object notation document, the child property and the matching child property are merged into the merged delta object notation document based on a first delta directive in the child property and a second delta directive in the corresponding matching child property.

TECHNICAL FIELD

The present disclosure relates to computer-implemented methods,software, and systems for creating and merging delta object notationdocuments.

BACKGROUND

An object notation format, such as JSON (JavaScript Object Notation),can be a language-independent text format that can be human readable.Object notation content can include a collection of name/value pairs,which can describe objects, records, dictionaries or other types ofdata. Name/value pairs can be referred to as properties (or in somecases, attributes), with a property name and property value included inthe name/value pair. Object notation can be parsed and consumed inmultiple computing environments, as well as by human readers. Data in anobject notation format can be streamed and sent between computingdevices, as one example.

SUMMARY

The present disclosure involves systems, software, and computerimplemented methods for creating and merging delta object notationdocuments. One example method includes: receiving a request to merge afirst delta object notation document and a second delta object notationdocument into a merged delta object notation document; identifying childproperties in the first delta object notation document, wherein eachchild property includes a delta directive and an affected property namethat the delta directive is configured to affect; for each respectivechild property in the first delta object notation document: determiningwhether a matching child property exists in the second delta objectnotation document that has a same affected property name as therespective child property; in response to determining that a matchingchild property exists in the second delta object notation document,merging the respective child property and the matching child propertyinto the merged delta object notation document based on a first deltadirective in the respective child property and a second delta directivein the corresponding child property; and in response to determining thata matching child property for the respective child property does notexist in the second delta object notation document, adding therespective child property to the merged delta object notation document;and providing the merged delta object notation document in response tothe request.

Implementations may include one or more of the following features. Childproperties in the second delta object notation document that have notbeen matched to the first object notation document can be determined.The child properties from the second delta object notation document thathave not been matched to the first object notation document can be addedto the merged delta object notation document. The first delta objectnotation document can describe differences between a first version of anobject notation document and a second version of the object notationdocument. The second version can be a later version of the objectnotation document than the first version. The second delta objectnotation document can describe differences between the second version ofthe object notation document and a third version of the object notationdocument. The third version can be a later version of the objectnotation document than the second version. The object notation document,the first delta object notation document, the second delta objectnotation document, and the merged delta object notation document can bein a JavaScript Object Notation (JSON) format. The first delta directiveand the delta second directive can each be one of an addition directive,a deletion directive, an atomic change directive, a structural changedirective, or a type-change directive. Merging the respective childproperty and the matching child property into the merged delta objectnotation document based on the first delta directive in the respectivechild property and the second delta directive in the corresponding childproperty can include determining that a combination of the first deltadirective and the second delta directive is a valid combination. Amerged child property can be generated based on a predefined ruleconfigured for the combination of the first delta directive and thesecond delta directive. The merged child property can include theaffected property and a merged delta directive that is based on thefirst delta directive and the second delta directive. The merged childproperty can be included in the merged delta object notation document.Merging the respective child property and the matching child propertyinto the merged delta object notation document based on the first deltadirective in the respective child property and the second deltadirective in the corresponding child property can include determiningthat a combination of the first delta directive and the second deltadirective is not a valid combination. Based on determining that thecombination of the first delta directive and the second delta directiveis not a valid combination, a determination can be made to not includethe matched child property in the merged delta object notation document.

While generally described as computer-implemented software embodied ontangible media that processes and transforms the respective data, someor all of the aspects may be computer-implemented methods or furtherincluded in respective systems or other devices for performing thisdescribed functionality. The details of these and other aspects andembodiments of the present disclosure are set forth in the accompanyingdrawings and the description below. Other features, objects, andadvantages of the disclosure will be apparent from the description anddrawings, and from the claims.

DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram illustrating an example system for creatingand merging delta object notation documents.

FIG. 2A is a table that illustrates generation of delta JSON documentsfrom first and second JSON documents.

FIG. 2B is a table that illustrates use of hash values in a delta JSONdocument

FIG. 3A is a table that illustrates a syntax for a delta JSON document.

FIG. 3B is a table that illustrates optional syntax for describingobject notation changes related to arrays.

FIG. 3C is a table that illustrates optional syntax for enablingbackward updates.

FIG. 4 is a flowchart of an example method for creating delta objectnotation documents.

FIG. 5 illustrates creation of a merged delta JSON document.

FIG. 6 illustrates example code for merging two delta JSON documents.

FIG. 7 is a table that describes processing for different delta JSONdocument merge scenarios.

FIGS. 8A and 8B illustrate examples of merging different combinations ofdirectives included in two delta JSON documents that are being merged.

FIG. 9 illustrates example code for merging two delta JSON documentsusing a table for performance improvement.

FIG. 10 is a flowchart of an example method for creating a merged deltaobject notation document.

DETAILED DESCRIPTION

Objection notation content, such as JSON documents, can be lightweight,platform and language-independent transport options. In some systems,different versions of a same JSON document may be generated over time. Auser or system may wish to know differences between two versions of aJSON document. A delta that describes differences between two JSONdocuments can be generated and can also be represented as a JSONdocument. A delta JSON document can adhere to a standard format and canrepresent differences between two JSON documents, such as an olderreference document and a newer changed document. When creating the deltaJSON document, two parsing trees of respective JSON documents can becompared, and changes such as additions, deletions, value changes, anddata type changes can be automatically detected, with a result returnedin a JSON format.

The delta JSON document described herein can result in severaladvantages over other approaches for object notation comparison. Thedelta JSON document described herein can be smaller than deltas storedin other formats, such as arrays. Array formats can repeat informationfor a changed entity, for example. Generating tree-like JSON contentthat is similar in format to source JSON documents to describedifferences in JSON documents can result in a format that more closelyaligns with and is more familiar to the compared JSON documents, thanalternative formats, such as arrays or other data structures.Accordingly, the delta JSON document described herein can be more humanreadable than other formats, such as arrays. Operations represented in aJSON delta can be independent, which can make applying a JSON delta moreefficient and less error prone than other approaches in which listedoperations are dependent.

Once multiple delta JSON documents exist, users or applications maydesire to merge consecutive delta JSON documents into a single deltaJSON document, to save space and to only have to deal with one ratherthan multiple documents. More than two delta JSONs can be combinedeventually into a single, merged delta JSON, by performing multiplemerge processes.

Merging can be an efficient way to combine delta files into a combineddelta file. A combined delta file can be smaller than a sum of the deltafiles that are combined, due to optimizations. Merging can includeremoval of inefficient or irrelevant content, for example.

For example, a merge process can automatically optimize a resultingmerged delta JSON in a way that unnecessary steps are removed. Forinstance, a first delta that describes changes between first and secondversions of a document can describe a change to an element and a seconddelta that describes changes between versions two and three of adocument can describe a deletion of the element. The merge process candetect this combination and perform the merge in such a way that the nowirrelevant change is not recorded in the merged delta document (e.g., achange to a property that is deleted in a next version may not bemeaningful to users or applications).

FIG. 1 is a block diagram illustrating an example system 100 forcreating and merging delta object notation documents. Specifically, theillustrated system 100 includes or is communicably coupled with a server102, a client device 104, and a network 106. Although shown separately,in some implementations, functionality of two or more systems or serversmay be provided by a single system or server. In some implementations,the functionality of one illustrated system or server may be provided bymultiple systems or servers.

A user or an application may want to use JSON (or other object notation)documents. For example, a user may use a client application 108, such asa browser or editor, to view JSON documents. The client application 108may display JSON documents that are copies of JSON documents 110received from the server 102, for example. As another example, theclient application 108 and/or a server application 112, or anotherapplication or system may access, read, and process the JSON documents110 (or copies of the JSON documents 110).

The JSON documents 110 can include, for a given JSON document, multipleversions of the JSON document. For instance, newer version(s) of adocument may be generated and may reflect change(s) from olderversion(s) of a document. A user, or an application, may desire to viewdifferences between two JSON documents. The client application 108 mayrequest a delta generation from a JSON engine, for example. The clientapplication 108 can send a delta generation request to a JSON engine 114running on the server 102 (or another server) or to a local JSON engine116 running on the client device 104.

The JSON engine 114 (and/or the JSON engine 116) can include a JSONparser 118. The JSON parser 118 can generate JSON parse trees 120 fromJSON documents 110. The JSON parser 118 can read a JSON document 110 andconvert the JSON document 110 into a JSON parse tree 120. JSON parsetrees 120 can be internal representations used by consumers of the JSONdocuments 110. An internal representation can be optimized for efficientnavigation and manipulation. Data can be stripped of white space,properties can be sorted, etc. Navigation supported by a JSON parse tree120 can include querying for particular properties, retrieving elementsat particular levels (e.g., top level, nested levels), etc.

The JSON engine 114 (and/or the JSON engine 116) can include a deltaJSON generator 122 that can generate delta JSON documents 124 (e.g.,from the JSON parse trees 120). Delta JSON documents 124 can describethe following types of changes between compared JSON documents: aproperty was added, a property was deleted, a property value waschanged, or a property value has changed its type. Delta JSON documents124 can be also in a JSON format, which can aid human readers andautomated processes. Since delta JSON documents are JSON documentsthemselves, the delta JSON generator 122 can create a delta JSONdocument 124 that describes differences between two delta JSONdocuments.

As another example, a delta JSON merger 126 can merge changes reflectedin consecutive delta JSON documents into a merged delta JSON document128. The delta JSON merger 126 can process two consecutive delta JSONdocuments, e.g., a first delta JSON_(n, n+1) that describes differencesbetween a JSON version n and a JSON version n+1, and a second deltaJSON_(n+1, n+2) that describes differences between the JSON version n+1and a JSON version n+2. The delta JSON merger 126 can generate a mergeddelta JSON document 128 that combines the differences in the two deltaJSONs. The delta JSON merger 126 can perform a merge by processing justthe two delta JSON documents (e.g., without needing to process theoriginal JSON documents 110). As mentioned above (and in more detailbelow), optimizations can be performed so that the merged delta JSONdocument 128 is smaller than a simple concatenation of the two deltaJSON documents 124 that are merged.

The delta JSON merger 126 and the delta JSON generator 122 can beuseful, for example, in software development workbench scenarios, wherea user manipulates and stores artifacts in a JSON format, and may oftensave multiple versions of such documents.

As used in the present disclosure, the term “computer” is intended toencompass any suitable processing device. For example, although FIG. 1illustrates a single server 102, and a single client device 104, thesystem 100 can be implemented using a single, stand-alone computingdevice, two or more servers 102, or two or more client devices 104.Indeed, the server 102 and the client device 104 may be any computer orprocessing device such as, for example, a blade server, general-purposepersonal computer (PC), Mac®, workstation, UNIX-based workstation, orany other suitable device. In other words, the present disclosurecontemplates computers other than general purpose computers, as well ascomputers without conventional operating systems. Further, the server102 and the client device 104 may be adapted to execute any operatingsystem, including Linux, UNIX, Windows, Mac OS®, Java™, Android™, iOS orany other suitable operating system. According to one implementation,the server 102 may also include or be communicably coupled with ane-mail server, a Web server, a caching server, a streaming data server,and/or other suitable server.

Interfaces 140 and 142 are used by the client device 104 and the server102, respectively, for communicating with other systems in a distributedenvironment—including within the system 100—connected to the network106. Generally, the interfaces 140 and 142 each comprise logic encodedin software and/or hardware in a suitable combination and operable tocommunicate with the network 106. More specifically, the interfaces 140and 142 may each comprise software supporting one or more communicationprotocols associated with communications such that the network 106 orinterface's hardware is operable to communicate physical signals withinand outside of the illustrated system 100.

The server 102 includes one or more processors 144. Each processor 144may be a central processing unit (CPU), a blade, an application specificintegrated circuit (ASIC), a field-programmable gate array (FPGA), oranother suitable component. Generally, each processor 144 executesinstructions and manipulates data to perform the operations of theserver 102. Specifically, each processor 144 executes the functionalityrequired to receive and respond to requests from the client device 104,for example.

Regardless of the particular implementation, “software” may includecomputer-readable instructions, firmware, wired and/or programmedhardware, or any combination thereof on a tangible medium (transitory ornon-transitory, as appropriate) operable when executed to perform atleast the processes and operations described herein. Indeed, eachsoftware component may be fully or partially written or described in anyappropriate computer language including C, C++, Java™, JavaScript®,Visual Basic, assembler, Perl®, any suitable version of 4GL, as well asothers. While portions of the software illustrated in FIG. 1 are shownas individual modules that implement the various features andfunctionality through various objects, methods, or other processes, thesoftware may instead include a number of sub-modules, third-partyservices, components, libraries, and such, as appropriate. Conversely,the features and functionality of various components can be combinedinto single components as appropriate.

The server 102 includes memory 146. In some implementations, the server102 includes multiple memories. The memory 146 may include any type ofmemory or database module and may take the form of volatile and/ornon-volatile memory including, without limitation, magnetic media,optical media, random access memory (RAM), read-only memory (ROM),removable media, or any other suitable local or remote memory component.The memory 146 may store various objects or data, including caches,classes, frameworks, applications, backup data, business objects, jobs,web pages, web page templates, database tables, database queries,repositories storing business and/or dynamic information, and any otherappropriate information including any parameters, variables, algorithms,instructions, rules, constraints, or references thereto associated withthe purposes of the server 102.

The client device 104 may generally be any computing device operable toconnect to or communicate with the server 102 via the network 106 usinga wireline or wireless connection. In general, the client device 104comprises an electronic computer device operable to receive, transmit,process, and store any appropriate data associated with the system 100of FIG. 1. The client device 104 can include one or more clientapplications, including the client application 108. A client applicationis any type of application that allows the client device 104 to requestand view content on the client device 104. In some implementations, aclient application can use parameters, metadata, and other informationreceived at launch to access a particular set of data from the server102. In some instances, a client application may be an agent orclient-side version of the one or more enterprise applications runningon an enterprise server (not shown).

The client device 104 further includes one or more processors 148. Eachprocessor 148 included in the client device 104 may be a centralprocessing unit (CPU), an application specific integrated circuit(ASIC), a field-programmable gate array (FPGA), or another suitablecomponent. Generally, each processor 148 included in the client device104 executes instructions and manipulates data to perform the operationsof the client device 104. Specifically, each processor 148 included inthe client device 104 executes the functionality required to sendrequests to the server 102 and to receive and process responses from theserver 102.

The client device 104 is generally intended to encompass any clientcomputing device such as a laptop/notebook computer, wireless data port,smart phone, personal data assistant (PDA), tablet computing device, oneor more processors within these devices, or any other suitableprocessing device. For example, the client device 104 may comprise acomputer that includes an input device, such as a keypad, touch screen,or other device that can accept user information, and an output devicethat conveys information associated with the operation of the server102, or the client device 104 itself, including digital data, visualinformation, or a GUI 150.

The GUI 150 of the client device 104 interfaces with at least a portionof the system 100 for any suitable purpose, including generating avisual representation of the modeling application 108. In particular,the GUI 150 may be used to view and navigate the model 110, various Webpages, or other user interfaces. Generally, the GUI 150 provides theuser with an efficient and user-friendly presentation of business dataprovided by or communicated within the system. The GUI 150 may comprisea plurality of customizable frames or views having interactive fields,pull-down lists, and buttons operated by the user. The GUI 150contemplates any suitable graphical user interface, such as acombination of a generic web browser, intelligent engine, and commandline interface (CLI) that processes information and efficiently presentsthe results to the user visually.

Memory 152 included in the client device 104 may include any memory ordatabase module and may take the form of volatile or non-volatile memoryincluding, without limitation, magnetic media, optical media, randomaccess memory (RAM), read-only memory (ROM), removable media, or anyother suitable local or remote memory component. The memory 152 maystore various objects or data, including user selections, caches,classes, frameworks, applications, backup data, business objects, jobs,web pages, web page templates, database tables, repositories storingbusiness and/or dynamic information, and any other appropriateinformation including any parameters, variables, algorithms,instructions, rules, constraints, or references thereto associated withthe purposes of the client device 104.

There may be any number of client devices 104 associated with, orexternal to, the system 100. For example, while the illustrated system100 includes one client device 104, alternative implementations of thesystem 100 may include multiple client devices 104 communicably coupledto the server 102 and/or the network 106, or any other number suitableto the purposes of the system 100. Additionally, there may also be oneor more additional client devices 104 external to the illustratedportion of system 100 that are capable of interacting with the system100 via the network 106. Further, the term “client”, “client device” and“user” may be used interchangeably as appropriate without departing fromthe scope of this disclosure. Moreover, while the client device 104 isdescribed in terms of being used by a single user, this disclosurecontemplates that many users may use one computer, or that one user mayuse multiple computers.

FIG. 2A is a table 200 that illustrates generation of delta JSONdocuments from first and second JSON documents. A JSON document is anexample of an object notation document. Two JSON documents can becompared, to create a delta JSON document. Comparing can includenavigating property/attribute trees of both JSON documents, recursively,if nested objects exist, comparing properties that have a same parentobject.

In a first example 202, a first JSON document 204 is compared to asecond JSON document 206. JSON documents can include property name/valuepairs. For example, the first JSON document 204 includes multipleproperty name/value pairs. For instance, a “user” property has a valueof “Miller,” an “action” property has a value of “enter,” and an“attempts” property has a value of 3. The first JSON document 204includes a property with a name of “name” that has a nested object asits value. The nested object has a “first name” property with a value of“Peter,” a “middle name” property with a null value, and a “last name”property with a value of “Miller.”

The second JSON document 206 is identical to the first JSON document204, so a result of a delta JSON comparison for this example is an deltaJSON document 208 that includes an empty object. A delta JSON documentthat includes an empty object (e.g., represented as empty brackets “0”)can be used to indicate that no differences exist between compared JSONdocuments. Another type of result, such as an empty string “ ” oranother kind of indicator (e.g., an error indicator) can be generated asa comparison result if one or both of the compared JSON documents arenot valid. JSON documents can be parsed and validated before comparison,for example, to determine whether the compared documents include validJSON syntax.

In a second example 210, a first JSON document 212 is compared to asecond JSON document 214, and even though the second JSON document 214includes a different ordering of some properties (e.g., an “action”property appears before the “name” property in the first JSON document212 but appears after the “name” property in the second JSON document214), the two JSON documents are treated as equal (as indicated by anempty delta JSON document 216). A JSON parser can sort properties beforecomparison (and perform other processing, such as removal of whitespace), so that irrelevant differences are not treated as differencesfor purposes of generating a delta JSON output, when source documentsare compared.

In a third example 218, a first JSON document 220 is compared to asecond JSON document 222. The second JSON document 222 does not includean “attempts” property or a “name” object that are included in the firstJSON document 220. Accordingly, a delta JSON document 224 can includeoperation properties that describe the differences between the firstJSON document 220 and the second JSON document 222. The delta JSONdocument 224 includes a “X” property, which is a placeholder thatindicates that change(s) have occurred to the first JSON document 220.

The value of the “X” property in the delta JSON document 224 is a nestedobject that has two properties. The first property/value pair in thenested object is

-   -   “−:attempts”:3        e.g., with a property name of “−:attempts” and a property value        of 3. The dash character “−” indicates deletion. A property name        after the dash (e.g., “attempts”) indicates which property in        the first JSON document 220 was deleted. The value of 3        indicates a value that was deleted. Similarly, the second        property/value pair in the nested object within the delta JSON        document 224 is    -   “−:name”:“{ . . . }”        e.g., with a property name of “−:name” and a property value of        “{ . . . }”. The “−:name” property name indicates deletion of        the “name” property from the first JSON document 220. Since        “name” has an object as a value in the first JSON document 220,        a placeholder value of “{ . . . }” is included in the delta JSON        document 224 to indicate an object was deleted.

In general, for deletions, any property that has a name that is found ina first JSON document JSON1, but not in a second JSON document JSON2 canbe treated as a deleted property and can be included in a delta JSONdocument using the following schema: “−:<name of deletedproperty>”:<value of deleted property in JSON1>. In someimplementations, for objects and arrays or for properties in general,the deleted property value is not specified fully, but can include aplaceholder string, such as “{ . . . }” or “[ . . . ]”. In someimplementations, the value (or type) of the deleted property can beincluded for reference purposes, for example. In some implementations,only an indication of a type of deleted value is included (forreference).

In a fourth example 226, a first JSON document 228 is compared to asecond JSON document 230. The second JSON document 230 does not includea “middle name” property within the “name” object as does the first JSONdocument 228. Accordingly, a delta JSON document 232 can include anoperation property that describes the difference between the first JSONdocument 228 and the second JSON document 230. As described above, thedelta JSON document 232 includes a “X” property, which is a placeholderthat indicates that change(s) have occurred to the first JSON document228.

The value of the “X” property in the delta JSON document 232 is aproperty/value pair, with the property name being “X:name” to indicatethat a change has occurred to the “name” property within the first JSONdocument 228. The value of the “X:name” property is

-   -   {“−:middle name”:null}        which indicates that a “middle name” property was deleted from        the “name” property, and that the value of the “middle name”        property was null.

In a fifth example 234, a first JSON document 236 is compared to asecond JSON document 238. The second JSON document 238 includes an“attempts” property and a “name” object that are not included in thefirst JSON document 236. The “attempts” property and the “name” objecthave been added to the second JSON document 238, for example.Accordingly, a delta JSON document 240 can include an operation propertythat describes the differences between the first JSON document 236 andthe second JSON document 238. As described above, the delta JSONdocument 240 includes a “X” property, which is a placeholder thatindicates that change(s) have occurred to the first JSON document 236.

The value of the “X” property in the delta JSON document 240 is a nestedobject that has two properties. The first property/value pair in thenested object is

-   -   “+:attempts”:3        e.g., with a property name of “+:attempts” and a property value        of 3. The plus character “+” indicates addition. A property name        after the plus character (e.g., “attempts”) indicates which        property was added (e.g., in the second JSON document 238). The        value of 3 after “+:attempts” indicates that a value of 3 was        added as a property value for the “attempts” property. The        second property/value pair in the nested object within the delta        JSON document 240 is        “+:name”:{“first name”:“Peter”,“middle name”:null,“last        name”:“Miller”}        e.g., with a property name of “+name” and a property value of a        nested object. The nested object includes three properties        (“first name”, “middle name”, and “last name”, with        corresponding values. The “+name” property name indicates        addition of the “name” property to the second JSON document 238.

In general, for additions, any property that has a name that is found ina second JSON document JSON2, but not in a first JSON document JSON1,can be treated as a new property and can be included in a delta JSONdocument using the following schema: “+:<name of added property>”:<valueof added property in JSON2>.

In a sixth example 242, a first JSON document 244 is compared to asecond JSON document 246. The second JSON document 244 includes a“title” property within the “name” object that is not included in thefirst JSON document 244. Accordingly, a delta JSON document 248 caninclude an operation property that describes the differences between thefirst JSON document 244 and the second JSON document 246. As describedabove, the delta JSON document 248 includes a “X” property, which is aplaceholder that indicates that change(s) have occurred to the firstJSON document 244.

The value of the “X” property in the delta JSON document 248 is aproperty/value pair, with the property name being “X:name” to indicatethat a change has occurred to the “name” property within the first JSONdocument 244. The value of the “X:name” property is

-   -   {“+:title”:“Dr.”}        which indicates that a “title” property was added to the “name”        property, and that the value of the “title” property is “Dr.”.

In a seventh example 250, a first JSON document 252 is compared to asecond JSON document 254. In the first JSON document 252, the value ofthe “name” property is an object type whereas in the second JSONdocument 254 the value of the “name” property is a character stringtype. In other words, a type of the “name” property has changed betweenthe first JSON document 252 and the second JSON document 254.

A delta JSON document 256 can indicate a type change using a re-creationindicator (e.g., indicating that a property has been re-created with adifferent type). For instance, the delta JSON document 256 includes a “%name” property, with the “%” character indicating a re-creation (of the“name” property). A value of the “% name” property is “Dr. PeterMiller”, which is the value of the “name” property within the seconddelta JSON document 254. The “Dr. Peter Miller” value indicates the newtype (character string) as well as the new value. In general, forre-creations, any attribute that has a name that is found in both afirst JSON document JSON1 and a second JSON document JSON2 but withdifferent types can be treated as a recreated attribute and can berepresented in a delta document using a schema of “%:<name>”:<value ofrecreated property in JSON2>. For merging operations, a recreationoperation can apply, even if a type hasn't changed between delta JSONsthat are being merged (as described in more detail below).

A re-creation can be considered as a different type of change than asimple change to a property. Any property that has a name that is foundin both a first JSON document JSON1 and a second JSON document JSON2with an identical type but with different values can be treated as achanged property. If the property is of type array or object, a changedproperty can be included in a delta document according to the followingschema: “X:<name of changed property>”:<deltaJSON describing the changesof the property value from JSON1 to JSON2>. For example, the process maybe continued recursively on the value of the property. If the propertyis of type Boolean, string, number or null, the value from JSON2 can beused directly. For example, the changed property can be included in adelta document according to the following schema: “X:<name of changedproperty>”:<value of changed property in JSON2>.

In an eighth example 258, a first JSON document 260 is compared to asecond JSON document 262. The second JSON document 262 includes a nullvalue 264. A delta JSON document 266 includes a “%” property whichindicates that the overall type of the top level of the first JSONdocument 260 has changed. The value of the “%” property is “null”,indicating that a new type of the top level of the second JSON document262 is null.

FIG. 2B is a table 280 that illustrates use of hash values in a deltaJSON document. In this example, a first JSON document 282 is compared toa second JSON document 284 to generate a delta JSON document 286. Adifference between the first JSON document 282 and the second JSONdocument 284 is that a value of an “action” property is “entering” inthe first JSON document 282 but “enter” in the second JSON document 284.Accordingly, the delta JSON document 286 includes a “X:action” propertywith a value of “enter”, to indicate the changed value of the “action”property.

The delta JSON document 286 includes a first hash value 288 that isbased on the first JSON document 282, a second hash value 290 that isbased on the second JSON document 284, and a third hash value 292 thatis based, for example, on the contents of the delta JSON document otherthan the included hash values. A hash value included in a delta JSONdocument can be used to verify the delta JSON document before using thedelta JSON document.

For instance, at a time after the delta JSON document 286 is generated,a user (or an application) may have a copy of the first JSON document282 and a copy of the delta JSON document 286 but may not be certainthat the delta JSON document 286 was generated from the first JSONdocument 282. Before applying the delta JSON document 286 to the copy ofthe first JSON document 282, a hash value can be generated from the copyof the first JSON document 282 and compared to the first hash value 288included in the copy of the delta JSON document 286. In general, a hashnumber can be used as a control mechanism to verify that a delta JSONdocument was actually generated using a particular source JSON document(and is therefore applicable to the source JSON document). Although hashvalues of JSON documents are described, in some implementations, hashvalues of internal canonical representations of JSON documents aregenerated and used for verification.

FIG. 3A is a table 300 that illustrates a syntax for a delta JSONdocument. The syntax for a delta JSON document can be defined by adeltaJSON pattern identifier 302 which is a placeholder for a delta JSONdocument pattern 304. The delta JSON document pattern 304 indicates thata delta JSON document can be either an empty object (e.g., indicated by{ }) or an object that has one name/value pair. The one name/value pairin the delta JSON document can have a name of “X” indicating a top levelchange, or “%” indicating a recreation. When the name is “X”, thecorresponding value can be a an object with one or more JSON properties,indicated in the delta JSON document pattern 304 by a deltaJsonPropspattern identifier 306, or a simple JSON expression. When the name ofthe one name/value pair in the delta JSON object is “%” thecorresponding value can be a JSON expression.

The deltaJsonProps pattern identifier 306 is a placeholder for a deltaJSON properties pattern 308 which represents a list of one or more deltaJSON properties. For instance, the delta JSON properties pattern 308indicates that the list of one or more JSON properties can be either asingle JSON property (indicated in the delta JSON properties pattern 308by a deltaJsonProp pattern identifier 310) or a list of multiple JSONproperties (indicated by a sequence of a deltaJsonProps patternidentifier and a deltaJsonProp identifier).

The deltaJsonProp pattern identifier 310 is a placeholder for a JSONproperty pattern 312. The JSON property pattern 312 indicates that aJSON property in the delta JSON object can be either an additionoperator, a recreation operator, a change operator, or a deletionoperator (represented in the JSON property pattern 312 by an opAdditionpattern identifier 314, an opRecreate pattern identifier 316, anopChange pattern identifier 318, or an opDeletion pattern identifier320, respectively).

The opAddition pattern identifier 314 is a placeholder for an additionoperation pattern 322. The addition operation pattern 322 indicates thatan addition operation is specified by a name value pair that has a namethat begins with “+:” followed by a name of an added JSON property (withthe added property indicated in the addition operation pattern 322 by aJsonPropertyName identifier). The corresponding value of the name/valuepair in the addition operation is a JSON value to include as the valueof the added JSON property.

The opRecreate pattern identifier 316 is a placeholder for a recreationoperation pattern 324. The recreation operation pattern 324 indicatesthat a recreation operation is specified by a name value pair that has aname that begins with “%:” followed by a name of a JSON property thatwas recreated (e.g., with a new data type), with the property that wasrecreated indicated in the recreation operation pattern 324 by aJsonPropertyName identifier. The corresponding value of the name/valuepair in the recreation operation is a JSON value to include as the valueof the recreated JSON property.

The opChange pattern identifier 318 is a placeholder for a changeoperation pattern 326. The change operation pattern 326 indicates that achange operation is specified by a name value pair that has a name thatbegins with “X:” followed by a name of a JSON property that was changed,with the property that was changed indicated in the change operationpattern 326 by a JsonPropertyName identifier. The corresponding value ofthe name/value pair in the change operation indicates what value thechanged property was changed to, and can be either a simple JSONexpression, or an object with one or more JSON properties (e.g., asindicated by a deltaJsonProps identifier). A simple JSON expression isany JSON entity that is neither an object nor an array (e.g., a number,string, Boolean value, or null value).

The opDeletion pattern identifier 320 is a placeholder for a deletionoperation pattern 328. The deletion operation pattern 328 indicates thata deletion operation is specified by a name value pair that has a namethat begins with “−:” followed by a name of a JSON property that wasdeleted, with the property that was deleted indicated in the deletionoperation pattern 328 by a JsonPropertyName identifier. Thecorresponding value of the name/value pair in the deletion operation isa type identifier that indicates a type of value that was deleted (e.g.,indicated in the deletion operation pattern 328 by a typeIdent patternidentifier 330).

The typeIdent pattern identifier 330 is a placeholder for a typeidentifier pattern 330. The type identifier pattern 330 indicates that atype identifier can be either a value 0 indicating that a numeric valuewas deleted, an empty string “ ” indicating that a string value wasdeleted, an empty object indicating that an object was deleted, a pairof array brackets [ ] indicating that an array was deleted, a valuefalse indicating that a Boolean value was deleted, or a null value.

In further detail, a delta JSON document is a document in a JSON format,which follows certain criteria. The top node of the delta JSON documentis an object which can be implicitly treated as a structuralchange—e.g., its content describes the changes of the addressed subtree.For the top node, these are the changes on the complete JSON. Everystructural change in the delta JSON document (except the top node) canhave a name that follows a pattern of “X:<n>”, where n is the originalname of the property. For a root node of the original JSON document(which has no name) a colon and the name can be omitted, hence changesto the root node can be indicated by, for example, a placeholderindicator of “X”. This entry is generally an attribute of the top nodeobject of the delta JSON Structural changes can have a property of typeobject. The property can include child attributes which follow a namingconvention of “<t>:<n>”, where <t>∈{“+”, “−”, “X”, “%”} and where <n> isthe name of the original property that is unique within its parent.Properties themselves can represent structural changes again with a namehaving a pattern of “X:<nc>”, where <nc> is the name of a child propertyof the original object property <n>, or the index of an entry of anoriginal array attribute <n>.

FIG. 3B is a table 340 that illustrates optional syntax for describingobject notation changes related to arrays. The optional syntax can beused, in some examples, to distinguish adaptation, where a documentedchange applies to an element of an array rather than an element of anobject. The optional syntax can apply to an addition operator, arecreation operator, a change operator, or a deletion operator(represented in the optional syntax by an opAddition pattern identifier342, an opRecreate pattern identifier 344, an opChange patternidentifier 346, or an opDeletion pattern identifier 348, respectively).

The opAddition pattern identifier 342, the opRecreate pattern identifier344, the opChange pattern identifier 346, and the opDeletion patternidentifier 348 are placeholders for an addition operation pattern 350, arecreation operation pattern 352, a change operation pattern 354, or adeletion operation pattern 356, respectively. The addition operationpattern 350, the recreation operation pattern 352, the change operationpattern 354, and the deletion operation pattern 356 are similar tocorresponding patterns in the syntax described above with respect toFIG. 3A. Each pattern in FIG. 3B includes an optional property valueoption, such as a property value option 358 of “+#<Number>”, where“Number” is the index of an array entry which should be manipulated. Insummary, a difference between the optional syntax in FIG. 3B fromcorresponding items in FIG. 3A is that for array item changes, a “#”rather than a “:”, following an operation character indicator (e.g.,“+”, “%”, “X”, “−””), signifies a change to an array.

FIG. 3C is a table 380 that illustrates optional syntax for enablingbackward updates. An opRecreate pattern identifier 382, an opChangepattern identifier 384, and an opDeletion pattern identifier 386 areplaceholders for a recreation operation pattern 388, a change operationpattern 390, or a deletion operation pattern 392, respectively. Therecreation operation pattern 388, the change operation pattern 390, andthe deletion operation pattern 392 include the same items as therecreation operation pattern 352, the change operation pattern 354, andthe deletion operation pattern 356 in FIG. 3B, respectively, but with anoptional value pattern as a last portion of a respective pattern.

For instance, the recreation operation pattern 388 includes a lastportion 394 of “[<JSON>,<JSON>]”, which describes a value pattern forenabling a property value in a delta object notation document toindicate a previous value and a changed value (with the changed valuehaving a different type than the previous value, due to the documentedrecreation). As another example, the change operation pattern 390includes a last portion 396 of “[<simple JSON>,<simple JSON of sametype>]”, which describes a value pattern for enabling a property valuein a delta object notation document to indicate a previous value and achanged value (with the changed value having the same type as theprevious value). As yet another example, the deletion operation pattern392 includes a last portion 398 of “[<JSON>]”, which describes a valuepattern whereby a property value in the delta object notation documentincludes the full JSON value of the property that was deleted.

Including the full JSON value of the property that was deleted canenable backward application of the delta JSON document. That is, inaddition to being able to apply the delta JSON document to a firstversion of a JSON document, to generate a second, subsequent version ofthe JSON document, full deletion information can enable application ofthe delta JSON document to the second version of the JSON document, togenerate the first version of the JSON document (e.g., with eitherscenario representing a situation where a user or application has oneversion of the JSON document and the delta JSON document, but not theother desired version of the JSON document).

FIG. 4 is a flowchart of an example method 400 for creating a deltaobject notation document. It will be understood that method 400 andrelated methods may be performed, for example, by any suitable system,environment, software, and hardware, or a combination of systems,environments, software, and hardware, as appropriate. For example, oneor more of a client, a server, or other computing device can be used toexecute method 400 and related methods and obtain any data from thememory of a client, the server, or the other computing device. In someimplementations, the method 400 and related methods are executed by oneor more components of the system 100 described above with respect toFIG. 1. For example, the method 400 and related methods can be executedby the delta JSON generator 122 of FIG. 1.

At 402, a request is received to create a delta object notation documentbased on a first object notation document and a second object notationdocument. An object notation document can include a root property andcan include other properties, with each non-root property having aproperty name and a property value. In some examples, a non-rootproperty can have an index within an array which is treated as a name.

At 404, the first object notation document is compared to the secondobject notation document to generate the delta object notation documentin an object notation format. The object notation format can be JSON.Before being compared, the first object notation document and the secondobject notation document can be parsed into respective internalrepresentations. Parsing can include, for example, removing white spaceor sorting properties.

For example, at 406, properties in the first object notation documentand the second object notation document are navigated to identifyproperties in the first object notation document and the second objectnotation document. Navigation can include recursive navigation of nestedproperties

At 408, a determination is made, for each property identified in thefirst object notation document or the second object notation document,as to whether a property with a same name and parent exists in acorresponding first object notation document or a corresponding secondobject notation document. A corresponding object notation document of agiven document is a document that is being compared to the givendocument.

At 410, in response to determining, for an identified property, that aproperty with a same name and parent does not exist in the correspondingfirst object notation document or the corresponding second objectnotation document, a property-change-operation property is generated, inthe object notation format, that indicates a difference between thefirst object notation document and the second object notation documentwith respect to the identified property.

At 412, in response to determining, for the identified property, that anidentical property does not exist in the corresponding first objectnotation document or the corresponding second object notation document,the property-change operation property is included in the delta objectnotation document.

For example, in response to determining that a first property is in thesecond object notation document and not in the first object notationdocument, an added-property-operation property that indicates anaddition of the first property to the second object notation documentcan be included in the delta object notation document. As anotherexample, in response to determining that a second property is in thefirst object notation document and is not in the second object notationdocument, a deleted-property-operation property that indicates adeletion of the second property from the first object notation documentcan be included, as the property-change-operation property in the deltaobject notation document. The deleted-property-operation may or may notinclude a value of the second property.

In response to determining that a third property is present in both thefirst object notation document and the second object notation documentwith a same type and different values, a changed-property-operationproperty that indicates a change in value for the third property betweenthe first object notation document and the second object notationdocument can be included as the property-change-operation property inthe delta object notation document. In response to determining that afourth property is present in both the first object notation documentand the second object notation document with a different type, arecreated-property-operation property that indicates a change in typefor the fourth property between the first object notation document andthe second object notation document can be included as theproperty-change operation property in the delta object notationdocument.

At 414, the delta object notation document is provided in response tothe request. In some implementations, a version information is includedin the delta object notation document.

After the delta object notation document is generated, the delta objectnotation document can be applied to the first object notation documentto produce the second object notation document. For instance, a user mayhave the first object notation document and the delta object notationdocument but not the second object notation document. Applying the deltaobject notation document can include performing an operation for eachproperty-change-operation property in the delta object notationdocument. In some implementations, a hash value generated based on thefirst object notation document is included in the delta object notationdocument and the hash value is used to verify that the delta objectnotation document was generated based on the first object notationdocument, before applying the delta object notation document to thefirst object notation document.

FIG. 5 illustrates creation of a merged delta JSON document. A JSONdocument can have multiple versions, as described above. For instance, aparticular JSON document may have first 502, second 504, and third 506versions. As described above, delta JSON documents can be created fromdifferent versions of a JSON document. For instance a first delta JSONdocument 510 has been created from the first version 502 and the secondversion 504 of the JSON document. As another example, a second deltaJSON document 510 has been created from the second version 504 and thethird version 506 of the JSON document.

Given two delta JSON documents, a merge tool can merge the two deltaJSON documents into a merged delta JSON document. For instance, a mergeddelta JSON document 512 has been created from the first delta JSONdocument 508 and the second delta JSON document 510. As described above,the merged delta JSON document 512 can be more convenient, being asingle document vs. multiple delta documents, and the merged delta JSONdocument 512 can be smaller than the sum of merged documents, sinceoptimizations can be performed to include only relevant/necessary deltaoperations (e.g., redundant or inverse operations can be merged orremoved).

As an example, the first delta JSON document 508 can include a firstdelta JSON object 516 and the second delta JSON document 510 can includea second delta JSON object 518. The first delta JSON object 516 includesa property that indicates that a property named “a” was deleted from thefirst version 502 of the JSON document when the first version 502 wascompared to the second version 504. The second delta JSON object 518includes a property that indicates that the property named “a” has beenadded to the third version 506 of the JSON document. The merge tool canevaluate a deletion directive in the first delta JSON object 516 and anaddition directive in the second delta JSON object 518 and determine toadd a merged delta JSON object 520 to the merged delta JSON document512. The merged delta JSON object 520 includes a recreation directive. Atype of directive to include in the merged delta JSON document 512 canbe determined, for example, based on predetermined rules that are basedon types of directives included in the two delta JSON documents that arebeing merged.

FIG. 6 illustrates example code 600 for merging two delta JSONdocuments. The code 600 can be executed to iterate over all direct childproperties of both nodes (e.g., a first node representing a first deltaJSON document and a second node representing a second delta JSONdocument) and perform a mergeDelta process for respective combinationsof properties. Recursive mergeDelta processing may be performed. Infurther detail, on line 1, a first iteration structure is executed toiterate over all child nodes (denoted as nc1) of the first node, witheach child node nc1 having a name that matches a pattern of “<t1>:<n1>”(e.g., an operation (“+”,“−”,“%” or “X”) represented by “t1” and anoriginal property name represented by “n1”.

At line 2, a first decision test is performed to determine whether theproperty name of the child node nc1 is equal to any property names n2 ofa child node nc2 of the second node (e.g., where the child node nc2 ofthe second node has a name with a pattern of “<t2>:<n2>”). If the firstdecision test is true, a mergeDelta process is performed, at line 3,using the child node nc1 of the first node and the child node nc2 of thesecond node. The mergeDelta process can be performed according to atable 700 described below with respect to FIG. 7. At lines 4-5, if aresult of the mergeDelta process is a directive, the directive is addedto a result delta JSON document. At lines 6-7, if the result of themergeDelta process is not a directive, the child node nc1 is not addedto the result delta JSON. If the first decision test is not true, thenat line 9, the child node nc1 is added to the result delta JSON documentunder the current node.

At line 10, a second iteration structure is executed to iterate over allchild nodes nc2 of the second node that were not processed duringexecution of the first iteration structure. At line 11, a current childnode nc2 being processed in the second iteration structure (e.g., achild node that was not processed in the first iteration structure) isadded to the result delta JSON document under the current node.

FIG. 7 is a table 700 that describes processing for different delta JSONdocument merge scenarios. The table 700 includes information for how tomerge a combination of two different types of delta JSON artifacts. Afirst column 702 and a first row 704 describe patterns of directivesthat may be included in a first delta JSON document or a second deltaJSON document, respectively, when the first delta JSON document is beingmerged with the second delta JSON document. For instance, the firstdelta JSON document may include an addition directive 706, a deletiondirective 708, an atomic change directive 710, a structural changedirective 712, or a recreation directive 714, for a property genericallynamed “n”. Similarly, the second delta JSON document may include anaddition directive 716, a deletion directive 718, an atomic changedirective 720, a structural change directive 722, or a recreationdirective 724, for the property named “n”.

The table 700 (or equivalent logic) can be referenced when one but notboth of the delta JSON documents include a directive for a property. Athird row 726 and a third column 728 each include rules or patternsindicating how to handle a situation when either only the first deltaJSON document or only the second delta JSON document include a directivefor a certain property, respectively. The third row 726 and the thirdcolumn includes patterns/rules that essentially indicate that if onlyone of the delta JSON documents being merged includes a directive for agiven property, that the directive be included in the merged delta JSONdocument.

A delta JSON document not including a directive for a given property canbe referred to as a directive type of zero for the given property, asindicated in a second row 730 and a second column 732, respectively. Thesecond row 730 and the second column 732 also indicate that directivetypes for addition, deletion, atomic changes, structural changes, andrecreations are one, two, three, four, and five, respectively. Directivetypes are used for discussing merge examples below.

For the remainder of the table 700 other than the first three rows andfirst three columns, the table 700 is structured so that a cell of thetable 700 at an intersection of a row and column in the table 700includes a predefined rule (or pattern) that indicates how to generate amerged delta JSON property from the two delta JSON properties related tothe “n” property that are included in the first delta JSON document andthe second delta JSON document. The table 700 can be referenced, forexample, when both delta JSON documents include delta directives for asame property (e.g., a property named “n”, or some other property name).

FIGS. 8A and 8B illustrate examples of merging different combinations ofdirectives included in two delta JSON documents that are being merged.The examples can be discussed with reference to the table 700 of FIG. 7.In a first example 802, a first delta JSON document and a second deltaJSON document each include a directive of type one (e.g., addition) fora property named “n”, e.g., as shown by directives 804 and 806,respectively. A merging of two additions (e.g., a merge type of 1/1) canbe considered as invalid, as indicated by a merge result error message808. If the “n” property is already included in a JSON document (e.g.,due to a first addition represented by the directive 804), then a secondaddition (e.g., corresponding to the directive 806), while the propertyis in the document, is not a valid operation. A cell 734 indicates thatthe combination of two additions for a same property is not applicable(e.g., not valid).

In this case, the second delta JSON document can be considered as notmatching (e.g., not fitting, not corresponding to) the first delta JSONdocument. In some implementations, hash values can be verified beforedelta JSON documents are merged. For example, a merge tool can verify,before performing a merge, whether a target hash code of a delta JSON n,n+1 is equal to a source hash code of a delta JSON n+1, n+2.

In a second example 810 in FIG. 8A, a first directive 812 in the firstdelta JSON document is an addition directive. A second directive 814 inthe second delta JSON document is a deletion directive, of the sameproperty (e.g., a property named “a”). A merged result 816 and a cell736 in the table 700 each indicate that no directive is to be includedin the merged delta JSON document when a deletion directive follows anaddition directive, for a same property.

A third example 818 illustrates a scenario discussed above, where thefirst delta JSON document includes a directive for a property (e.g., anaddition directive 820), and the second delta JSON document does notinclude a directive relevant to the property, e.g., as indicated by anote 822. A merged result 824 is equivalent to the addition directive820 (e.g., the directive included in just one of the delta JSONdocuments is essentially copied into the merged delta JSON document).

In a fourth example 826, a first directive 828 in the first delta JSONdocument is an addition directive. A second directive 830 in the seconddelta JSON document is a recreation directive, of the same property(e.g., a property named “a”). A merged result 832 and a cell 738 in thetable 700 each indicate that a combination of an addition and arecreation is to be included, in the merged delta JSON document, as anaddition directive.

In a fifth example 834, a first directive 836 in the first delta JSONdocument is a deletion directive. A second directive 838 in the seconddelta JSON document is an addition directive, of the same property(e.g., a property named “a”). A merged result 840 and a cell 740 in thetable 700 each indicate that a combination of an addition and arecreation is to be included, in the merged delta JSON document, as arecreation directive.

In a sixth example, in FIG. 8B, a first directive 850 in the first deltaJSON document and a second directive 852 in the second delta JSONdocument are each atomic change directives, of the same property. Amerged result 854 and a cell 742 in the table 700 each indicate that acombination of two atomic change directives is to result in the secondatomic change directive being included, in the merged delta JSONdocument.

In a seventh example 860, a first directive 862 in the first delta JSONdocument and a second directive 864 in the second delta JSON documenteach include a property “a”. Accordingly, a merge process is performed.An operation in the first directive 862 is “+”, and an operation in thesecond directive 864 is a “X” on an object (e.g., a structural change).Accordingly, cell 743 in the table 700 is applied, which results in theinclusion of an addition operation of the property “a” in a mergedresult 866. The value of the addition property is a value provided inthe first directive 862 with a change from the second directive 864applied. An inner delta JSON2 of {“X:name”:“value2”, “+:childs”:3}includes two changes, which are applied on {“name”:“value”}, whichresults in a resultant value of {“name”:“value2”,“childs”:3}. Theaddition operation combined with the resultant value is{“+:a”:{“name”:“value2”,“childs”:3}} (e.g., as shown for the mergedresult 866).

In an eighth example 870, a first directive 872 in the first delta JSONdocument and a second directive 874 in the second delta JSON documenteach include a property “a”. Accordingly, a merge process is performed.An operation in the first directive 872 and an operation in the seconddirective 874 are each a “X” on an object (e.g., a structural change).Accordingly, cell 744 in the table 700 is applied, which results inrecursive application on the corresponding values of {“+:childs”:3} and{“−:childs”:3}. (As mentioned above, for a deletion, rather than adeleted value of “3”, a value of “0” indicating a type of deleted valuecan be included, in the second directive 874). The recursive merging ofthe values {“+:childs”:3} and {“−:childs”:3} results in identificationof an addition operation and a deletion operation, which leads to cell736, which indicates that no directive is to be returned. As discussedfor FIG. 6, if no directive is returned, then an outer attribute (e.g.,“a” in this example) is also not returned (discarded). Accordingly, afinal merged result 876 can be an empty object. For example, the twochanges are cancelling each other and the merged deltaJSON is no longerconsidered a change.

In a ninth example 880, a first directive 882 in the first delta JSONdocument includes directives for “name”, “children”, and “hometown”properties. A second directive 884 in the second delta JSON documentincludes directives for “name”, “children”, and “kids” properties. Amerged result 886 shows a result of a merge process, with directives for“name” and directives for “children” being merged, and directives for“hometown” and “kids” being added to the merged result 886 (e.g., due tobeing in one but not the other delta JSON).

Referring again to FIG. 7, the table 700 includes other cells thatindicate other patterns for other combinations of directives. Forinstance, cells 745, 746, and 747 indicate that atomic changes,structural changes, or recreations, followed by a deletion, shouldresult in inclusion of the deletion directive (and not the otherdirective).

Some combinations are deemed to be invalid (e.g., as discussed above forthe cell 734). For example, cells 748, 750, and 752 are similar to thecell 734, in that they indicate that an addition of a property is notconsidered a valid operation if it follows an atomic change, astructural change, or a recreation of the same property (e.g., with asame understanding that adding something that is already included in adocument is not a valid operation.

As another example, cell 754 covers a case where a recreation isfollowed by a recreation. As indicated in the cell 754, such acombination can result in a recreation in the merged result. However, itmay or may not be the case that a type of the property switches on amerging of recreations. For instance, if two delta JSONs are mergedthere may be a situation where a recreate operation results even if thetype does actually not change. For example, a recreation from a numberto a string may be included in a first delta JSON (e.g., version 1 toversion 2 of a JSON) and a recreation from a string back to a number maybe included in a second delta JSON (e.g., version 2 to version 3 of theJSON). The merge process may longer have information on the type of theproperty in the first version of the JSON, and accordingly, the mergedrecreation operations can be treated as a recreation. A similar outcomecan occur as applied to the cell 740, when an addition in the seconddelta JSON follows a deletion in the first delta JSON (e.g., arecreation operation can be a merged result).

FIG. 9 illustrates example code 900 for merging two delta JSON documentsusing a table for performance improvement. The code 900 can be executedto improve performance using a local sorted table. In further detail, online 1, a first iteration structure is executed to iterate over allchild nodes (denoted as nc1) of the first node, with each child node nc1having a name that matches a pattern of “<t1>:<n1>” (e.g., an attributewith a name “t1” and an attribute value of “n1”. Within the firstiteration structure, a tuple is added to the local sorted table, withthe tuple having the values “<n1>”, nc1, and null.

Line 3 begins a recursion structure that processes all child nodes nc2of the second node, with each child node nc2 having a name that matchesa pattern of “<t2>:<n2>”. At line 4, a decision test is performed todetermine whether an entry in the local search table that matches the n2attribute value is found. If the entry is found, the entry is updated,at line 5, to tuple values of “<n1>”, nc1, nc2. If the entry is notfound, a tuple with values “<n2>”, null, nc2 is added to the localsorted table. At line 8, the mergeDelta is performed using the secondand third tuple values (e.g., second and third table columns,respectively), for all entries of the table.

FIG. 10 is a flowchart of an example method 1000 for creating a mergeddelta object notation document. It will be understood that method 1000and related methods may be performed, for example, by any suitablesystem, environment, software, and hardware, or a combination ofsystems, environments, software, and hardware, as appropriate. Forexample, one or more of a client, a server, or other computing devicecan be used to execute method 1000 and related methods and obtain anydata from the memory of a client, the server, or the other computingdevice. In some implementations, the method 1000 and related methods areexecuted by one or more components of the system 100 described abovewith respect to FIG. 1. For example, the method 1000 and related methodscan be executed by the delta JSON merger 126 of FIG. 1.

At 1002, a request is received to merge a first delta object notationdocument and a second delta object notation document into a merged deltaobject notation document. The first delta object notation documentdescribes differences between a first version of an object notationdocument and a second version of the object notation document. Thesecond version can be a later version of the object notation documentthan the first version. The second delta object notation documentdescribes differences between the second version of the object notationdocument and a third version of the object notation document. The thirdversion can be a later version of the object notation document than thesecond version. The object notation document, the first delta objectnotation document, the second delta object notation document, and themerged delta object notation document can be in a JavaScript ObjectNotation (JSON) format

At 1004, child properties are identified in the first delta objectnotation document. Each child property includes a delta directive and anaffected property name that the delta directive is configured to affect.

At 1006, processing is performed for each respective child property inthe first delta object notation document.

At 1008, a determination is made as to whether a matching child propertyexists in the second delta object notation document that has a sameaffected property name as the respective child property.

At 1010, in response to determining that a matching child propertyexists in the second delta object notation document, the respectivechild property and the matching child property are merged into themerged delta object notation document based on a first delta directivein the respective child property and a second delta directive in thecorresponding matching child property. The first delta directive and thedelta second directive can each be one of an addition directive, adeletion directive, an atomic change directive, a structural changedirective, or a type-change directive. Step 106 can be recursivelyrepeated, for nested child properties within the matching child property(with recursion possible to more than two levels).

Merging can include determining whether a combination of the first deltadirective and the second delta directive is a valid combination. If thecombination of the first delta directive and the second delta directiveis a valid combination, a merged child property can be generated basedon a predefined rule configured for the combination of the first deltadirective and the second delta directive. The merged child propertyincludes the affected property and a merged delta directive that isbased on the first delta directive and the second delta directive. Themerged child property can be included in the merged delta objectnotation document. Merging can include determining that a combination ofthe first delta directive and the second delta directive is not a validcombination, and accordingly, determining to not include the matchedchild property in the merged delta object notation document.Additionally, the merging process can be halted, and an error reported.

At 1012, in response to determining that a matching child property forthe respective child property does not exist in the second delta objectnotation document, the respective child property is added to the mergeddelta object notation document. Additionally, child properties in thesecond delta object notation document that have not been matched to thefirst object notation document can be identified, and added to themerged delta object notation document.

At 1014, the merged delta object notation document is provided inresponse to the request.

The preceding figures and accompanying description illustrate exampleprocesses and computer-implementable techniques. But system 100 (or itssoftware or other components) contemplates using, implementing, orexecuting any suitable technique for performing these and other tasks.It will be understood that these processes are for illustration purposesonly and that the described or similar techniques may be performed atany appropriate time, including concurrently, individually, or incombination. In addition, many of the operations in these processes maytake place simultaneously, concurrently, and/or in different orders thanas shown. Moreover, system 100 may use processes with additionaloperations, fewer operations, and/or different operations, so long asthe methods remain appropriate.

In other words, although this disclosure has been described in terms ofcertain embodiments and generally associated methods, alterations andpermutations of these embodiments and methods will be apparent to thoseskilled in the art. Accordingly, the above description of exampleembodiments does not define or constrain this disclosure. Other changes,substitutions, and alterations are also possible without departing fromthe spirit and scope of this disclosure.

What is claimed is:
 1. A computer-implemented method comprising:receiving a request to merge a first delta object notation document anda second delta object notation document into a merged delta objectnotation document; identifying child properties in the first deltaobject notation document, wherein each child property includes a deltadirective and an affected property name that the delta directive isconfigured to affect; for each respective child property in the firstdelta object notation document: determining whether a matching childproperty exists in the second delta object notation document that has asame affected property name as the respective child property; inresponse to determining that a matching child property exists in thesecond delta object notation document, merging the respective childproperty and the matching child property into the merged delta objectnotation document based on a first delta directive in the respectivechild property and a second delta directive in the correspondingmatching child property; and in response to determining that a matchingchild property for the respective child property does not exist in thesecond delta object notation document, adding the respective childproperty to the merged delta object notation document; and providing themerged delta object notation document in response to the request.
 2. Themethod of claim 1, further comprising: determining child properties inthe second delta object notation document that have not been matched tothe first object notation document; and adding, to the merged deltaobject notation document, the child properties from the second deltaobject notation document that have not been matched to the first objectnotation document.
 3. The method of claim 1, wherein the first deltaobject notation document describes differences between a first versionof an object notation document and a second version of the objectnotation document, wherein the second version is a later version of theobject notation document than the first version.
 4. The method of claim1, wherein the second delta object notation document describesdifferences between the second version of the object notation documentand a third version of the object notation document, wherein the thirdversion is a later version of the object notation document than thesecond version.
 5. The method of claim 4, wherein the object notationdocument, the first delta object notation document, the second deltaobject notation document, and the merged delta object notation documentare in a JavaScript Object Notation (JSON) format.
 6. The method ofclaim 1, wherein the first delta directive and the delta seconddirective are each one of an addition directive, a deletion directive,an atomic change directive, a structural change directive, or atype-change directive.
 7. The method of claim 1, wherein merging therespective child property and the matching child property into themerged delta object notation document based on the first delta directivein the respective child property and the second delta directive in thecorresponding child property includes determining that a combination ofthe first delta directive and the second delta directive is a validcombination.
 8. The method of claim 7, the method further comprising:generating a merged child property based on a predefined rule configuredfor the combination of the first delta directive and the second deltadirective, wherein the merged child property includes the affectedproperty and a merged delta directive that is based on the first deltadirective and the second delta directive; and including the merged childproperty in the merged delta object notation document.
 9. The method ofclaim 1, wherein merging the respective child property and the matchingchild property into the merged delta object notation document based onthe first delta directive in the respective child property and thesecond delta directive in the corresponding child property includesdetermining that a combination of the first delta directive and thesecond delta directive is not a valid combination.
 10. The method ofclaim 9, further comprising: based on determining that the combinationof the first delta directive and the second delta directive is not avalid combination, determining to not include the matched child propertyin the merged delta object notation document.
 11. A system comprising:one or more computers; and a computer-readable medium coupled to the oneor more computers having instructions stored thereon which, whenexecuted by the one or more computers, cause the one or more computersto perform operations comprising: receiving a request to merge a firstdelta object notation document and a second delta object notationdocument into a merged delta object notation document; identifying childproperties in the first delta object notation document, wherein eachchild property includes a delta directive and an affected property namethat the delta directive is configured to affect; for each respectivechild property in the first delta object notation document: determiningwhether a matching child property exists in the second delta objectnotation document that has a same affected property name as therespective child property; in response to determining that a matchingchild property exists in the second delta object notation document,merging the respective child property and the matching child propertyinto the merged delta object notation document based on a first deltadirective in the respective child property and a second delta directivein the corresponding matching child property; and in response todetermining that a matching child property for the respective childproperty does not exist in the second delta object notation document,adding the respective child property to the merged delta object notationdocument; and providing the merged delta object notation document inresponse to the request.
 12. The system of claim 11, wherein theoperations further comprise: determining child properties in the seconddelta object notation document that have not been matched to the firstobject notation document; and adding, to the merged delta objectnotation document, the child properties from the second delta objectnotation document that have not been matched to the first objectnotation document.
 13. The system of claim 11, wherein the first deltaobject notation document describes differences between a first versionof an object notation document and a second version of the objectnotation document, wherein the second version is a later version of theobject notation document than the first version.
 14. The system of claim11, wherein the second delta object notation document describesdifferences between the second version of the object notation documentand a third version of the object notation document, wherein the thirdversion is a later version of the object notation document than thesecond version.
 15. The system of claim 14, wherein the object notationdocument, the first delta object notation document, the second deltaobject notation document, and the merged delta object notation documentare in a JavaScript Object Notation (JSON) format.
 16. A computerprogram product encoded on a non-transitory storage medium, the productcomprising non-transitory, computer readable instructions for causingone or more processors to perform operations comprising: receiving arequest to merge a first delta object notation document and a seconddelta object notation document into a merged delta object notationdocument; identifying child properties in the first delta objectnotation document, wherein each child property includes a deltadirective and an affected property name that the delta directive isconfigured to affect; for each respective child property in the firstdelta object notation document: determining whether a matching childproperty exists in the second delta object notation document that has asame affected property name as the respective child property; inresponse to determining that a matching child property exists in thesecond delta object notation document, merging the respective childproperty and the matching child property into the merged delta objectnotation document based on a first delta directive in the respectivechild property and a second delta directive in the correspondingmatching child property; and in response to determining that a matchingchild property for the respective child property does not exist in thesecond delta object notation document, adding the respective childproperty to the merged delta object notation document; and providing themerged delta object notation document in response to the request. 17.The computer program product of claim 16, further comprising:determining child properties in the second delta object notationdocument that have not been matched to the first object notationdocument; and adding, to the merged delta object notation document, thechild properties from the second delta object notation document thathave not been matched to the first object notation document.
 18. Thecomputer program product of claim 16, wherein the first delta objectnotation document describes differences between a first version of anobject notation document and a second version of the object notationdocument, wherein the second version is a later version of the objectnotation document than the first version.
 19. The computer programproduct of claim 16, wherein the second delta object notation documentdescribes differences between the second version of the object notationdocument and a third version of the object notation document, whereinthe third version is a later version of the object notation documentthan the second version.
 20. The computer program product of claim 19,wherein the object notation document, the first delta object notationdocument, the second delta object notation document, and the mergeddelta object notation document are in a JavaScript Object Notation(JSON) format.